package com.yeswater.multithread.chapter1.test1_12.test2;

/**
 * author : yeswater
 * date : 2023/10/19
 */

public class SynchronizedObject {

    synchronized public void printString() {
        System.out.println("begin");
        if (Thread.currentThread().getName().equals("t1")) {
            System.out.println("thread t1 is always suspend !");
            Thread.currentThread().suspend();
        }
        System.out.println("end");
    }

}
